Skip to content

Conversation

@aschackmull
Copy link
Contributor

Base cases for TypeFlow are the places where we lose type information in a way that can affect dispatch. Stepping from an instantiated parameterised type to a fully unbound type was already covered. This PR extends this to also include the case when just 1 type argument goes from instantiated to un-instantiated.

This solves the provided example in #21066

@github-actions github-actions bot added the Java label Jan 12, 2026
@aschackmull
Copy link
Contributor Author

Dca is uneventful. I also did a MRVA top 1000 check focused mainly on risk reduction to measure tuples calculated in TypeFlow - only one repo went up with more than 10% (and not much more than that), so this change seems quite safe and fairly corner-case, but certainly worth it to shore up the identified hole.

@aschackmull aschackmull marked this pull request as ready for review January 13, 2026 07:47
@aschackmull aschackmull requested a review from a team as a code owner January 13, 2026 07:47
Copilot AI review requested due to automatic review settings January 13, 2026 07:47
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends TypeFlow base cases to handle transitions from instantiated to partially unbound parameterized types. Previously, only transitions to fully unbound types were covered. This enhancement addresses issue #21066 by capturing type information loss when individual type arguments become uninstantiated.

Changes:

  • Added partiallyUnbound predicate to detect parameterized types with unrestricted type arguments at specific positions
  • Extended the upcast predicate with a new base case for partially unbound type transitions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

hvitved
hvitved previously approved these changes Jan 13, 2026
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I guess it would be nice with a test case.

@aschackmull
Copy link
Contributor Author

it would be nice with a test case.

Done!

@aschackmull aschackmull merged commit 9c1351c into github:main Jan 13, 2026
19 checks passed
@aschackmull aschackmull deleted the java/typeflow-partially-unbound branch January 13, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Java no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants